-- By ScatmanJosh --

-- Variables --
XEN = XEN or {}

-- Blacklist --
XEN.Block = XEN.Block or {}
XEN.Block.Models =  XEN.Block.Models or {}
XEN.Block.Tools = XEN.Block.Tools or {}

-- Blacklist Functions --
function XEN.Block.AddModel( mdl ) --MDL:STRING
	table.insert( XEN.Block.Models, mdl )
	print( mdl.." added to blacklist." )
	return true, mdl
end

function XEN.Block.AddTool( tool ) --TOOL:STRING
	table.insert( XEN.Block.Tools, tool )
	print( tool.." added to restrictions." )
	return true, tool
end

function XEN.Block.IsBlocked( item ) --ITEM:STRING
	if table.HasValue( XEN.Block.Tools, item ) then return true
	elseif table.HasValue( XEN.Block.Models, item ) then return true
	else return false end
end

function XEN.Block.Remove( item ) --ITEM:STRING
	if table.HasValue( XEN.Block.Tools, item ) then
		local var = table.remove( XEN.Block.Tools, table.KeyFromValue( XEN.Block.Tools, item ) )
		print( "Tool: "..tostring( var ).." successfully removed." )
		return true
	elseif  table.HasValue( XEN.Block.Models, item ) then
		local var = table.remove( XEN.Block.Models, table.KeyFromValue( XEN.Block.Models, item ) )
		print( "Model: "..tostring( var ).." successfully removed." )
		return true
	else
		print( "Could not find "..tostring( item ).." or an error has occurred." )
		return false
	end
	print( "An error has occurred." )
	return false
end